#ifndef MAINAPP_H
#define MAINAPP_H

#include <QMainWindow>
#include <QLabel>
#include "cimageproc.h"
#include "histogramdialog.h"
#include "imgwindow.h"
#include "segmentationDialog.h"
#include "segmentationviewdialog.h"
#include "highpassfilterdialog.h"
#include "phasefilterdialog.h"
#include <QDebug>

class HistogramDialog;
class SegmentationDialog;
class SegmentationViewDialog;
class HighPassFilterDialog;
class PhaseFilterDialog;

namespace Ui
{
    class MainApp;
}

class MainApp : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainApp(QWidget *parent = 0);
    ~MainApp();
    void SetWindowForFilters(int);
    void ModifyImgByHistogram(int, float);
    void SetSplotMask(int);
    void DoNonLinearFilter(int);
    CImageProc* GetImg() { return m_Img; }
    //CImageProc* GetImg() { return m_Img; }
    //Click event = MousePress->MouseRelease
    void mousePressEvent ( QMouseEvent *);
    void HighPassFilter(float _r);
    void PhaseModFilter(int, int);
    bool activeOnMouse;
    ImgWindow               *m_OrigWnd;
    ImgWindow               *m_ProcWnd;
    SegmentationViewDialog  *mSegViewDialog;
    SegmentationDialog      *mSegDialog;
    //SegmentationDialog* GetSeg(){return};


private slots:
    void on_actionWyj_cie_triggered();

    void on_actionOtw_rz_triggered();

    void on_actionZapisz_triggered();

    void on_pushButton_clicked();

    void on_horizontalSlider_valueChanged(int value);

    void on_actionCofnij_triggered();

    void on_pushButton_2_clicked();

    void on_horizontalSlider_2_valueChanged(int value);

    void on_pushButton_3_clicked();

    void on_pushButtonSeg_clicked();

    void on_action_rednia_arytmetyczna_triggered();

    void on_actionMediana_triggered();

    void on_actionHistogram_jasno_ci_triggered();

    void on_actionSplot_triggered();

    void on_actionFiltracja_nieliniowa_triggered();

    void on_actionO_programie_triggered();

    void on_actionFFT_triggered();

    void on_actionIFFT_triggered();

    void on_actionSegmentacja_triggered();

    void on_actionWidmo_mocy_triggered();

    void on_actionWidmo_fazy_triggered();

    void on_actionFiltr_G_rnoprzepustowy_triggered();

    void on_actionFiltr_modyfikuj_cy_faze_triggered();

private:
    Ui::MainApp             *ui;
    CImageProc              *m_Img;
    bool                    m_FileOpened;
    bool                    m_ArithmeticFilterTriggered;
    HistogramDialog         *mHistDialog;


    HighPassFilterDialog    *m_HPFDialog;
    PhaseFilterDialog       *m_PModFDialog;
    int                     xOrig;
    int                     yOrig;
    int                     xProc;
    int                     yProc;
    int                     widthOrig;
    int                     heightOrig;
    bool                    buttonFlag;
    //int                 widthProc;
    //int                 heightProc;
};

#endif // MAINAPP_H

